package models

import (
	"time"
)

// MaGoodsClick [...]
type MaGoodsClick struct {
	ID           string    `gorm:"index:idx_ID_StartTime,priority:1;column:id;type:bigint;not null;comment:商户id"  json:"id" json_old:"ID"`
	SalesID      string    `gorm:"index:idx_sgse,priority:1,type:btree,comment:更新点击量使用;column:sales_id;type:varchar(50);not null;comment:售货识别ID 序列号"  json:"sales_id" json_old:"SalesID"`
	RobotName    string    `gorm:"column:robot_name;type:varchar(50);not null;comment:机器人名称"  json:"robot_name" json_old:"RobotName"`
	AddTime      time.Time `gorm:"index:idx_merchantid_addtime_starttime,priority:1;column:add_time;type:datetime;not null;comment:人脸数据添加时间"  json:"add_time" json_old:"AddTime"`
	ClickNum     int64     `gorm:"index:idx_smc,priority:3,type:btree,comment:统计某个时间段的点击量;column:click_num;type:int;not null;comment:人脸统计数"  json:"click_num" json_old:"ClickNum"`
	StartTime    time.Time `gorm:"index:idx_ID_StartTime,priority:2;index:idx_merchantid_addtime_starttime,priority:2;index:idx_smc,priority:1,type:btree,comment:统计某个时间段的点击量;index:idx_sgse,priority:3,type:btree,comment:更新点击量使用;column:start_time;type:datetime;default:null;comment:统计起始时间"  json:"start_time" json_old:"StartTime"`
	EndTime      time.Time `gorm:"index:end_time;index:idx_sgse,priority:4,type:btree,comment:更新点击量使用;column:end_time;type:datetime;not null;comment:统计结束时间"  json:"end_time" json_old:"EndTime"`
	GoodsID      string    `gorm:"index:GoodsID;index:idx_sgse,priority:2,type:btree,comment:更新点击量使用;column:goods_id;type:bigint;default:null;comment:所属机器的商品ID"  json:"goods_id" json_old:"GoodsID"`
	MerchantID   string    `gorm:"index:idx_merchantid_addtime_starttime,priority:3;index:idx_smc,priority:2,type:btree,comment:统计某个时间段的点击量;column:merchant_id;type:varchar(30);not null;comment:商户id" json:"merchant_id" json_old:"ID"`
	CreatedAt    int64     `gorm:"index:created_at;column:created_at;autoCreateTime;type:int;size:64;comment:创建时间" json:"created_at"`
	NewStartTime int64     `gorm:"column:new_start_time;type:int;size:64;comment:开始时间" json:"new_start_time"`
	NewEndTime   int64     `gorm:"column:new_end_time;type:int;size:64;comment:结束时间" json:"new_end_time"`
	CreatedDate  time.Time `gorm:"column:created_date;type:date;comment:日期" json:"created_date" json_old:"CreatedDate"`
}

// TableName get sql table name.获取数据库表名
func (m MaGoodsClick) TableName() string {
	return "ma_goods_click"
}

// 模式自动注册
func init() {
	Models = append(Models, &MaGoodsClick{})
}
